package com.ysd.dao.impl;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

import com.ysd.entity.LunBoTu;
import com.ysd.util.DBManger;

public class LunBoTuDaoImpl {
	public List<LunBoTu> getLunBoTuList(){
		List<LunBoTu> list = new ArrayList<LunBoTu>();
		Connection conn=DBManger.getConnection();
		Statement st=null;
		ResultSet rs=null;
		
		try {
			st=conn.createStatement();
			rs=st.executeQuery("select * from lunBoTu");
			while(rs.next()) {
				int lunBoTuId =rs.getInt("lunBoTuId");
				String lunBoTu = rs.getString("lunBoTu");
				LunBoTu lbt=new LunBoTu(lunBoTuId,lunBoTu);
				list.add(lbt);
			}
			return list;
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return null;
		}finally{
			DBManger.closeAll(conn, st, rs);
		}
	}
}
